<template>
  <div v-loading="loading" class="singer">
    <IndexList :data="singerList" @select="select" />
    <!-- <router-view /> -->
    <router-view v-slot="{ Component }">
      <transition appear name="slide">
        <component :is="Component" />
      </transition>
    </router-view>
  </div>
</template>

<script>
import { ref } from 'vue'
import useSingerApi from '@/views/Singer/useSingerApi'
import IndexList from '@/components/Base/IndexList/IndexList'
import { setObj } from '@/assets/js/sessionStore'
export default {
  name: 'Singer',
  components: {
    IndexList
  },
  computed: {
    loading() {
      return this.singerList.length === 0
    }
  },
  setup() {
    const singerList = ref([])

    useSingerApi(singerList)

    return { singerList }
  },
  methods: {
    select(singer) {
      setObj('SINGER', singer)
    }
  }
}
</script>

<style lang="scss" scoped>
.singer {
  height: 100%;
}
</style>
